﻿<Page
    x:Class="SampleVariableGridView.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SampleVariableGridView"
    xmlns:controls="using:SampleVariableGridView.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <controls:VariableGridView ItemsSource="{Binding Photos}">
            <controls:VariableGridView.ItemTemplate>
                <DataTemplate>
                    <Grid VariableSizedWrapGrid.ColumnSpan="{Binding ColumnSpan}">
                        <Image Stretch="UniformToFill" Source="{Binding ImageLarge}"></Image>
                    </Grid>
                </DataTemplate>
            </controls:VariableGridView.ItemTemplate>
            <controls:VariableGridView.ItemsPanel>
                <ItemsPanelTemplate>
                    <VariableSizedWrapGrid VerticalAlignment="Center"
                                           ItemHeight="150"
                                           ItemWidth="150"
                                           MaximumRowsOrColumns="5" />
                </ItemsPanelTemplate>
            </controls:VariableGridView.ItemsPanel>
        </controls:VariableGridView>
    </Grid>
</Page>
